<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('审核回退原因列表')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
    var prefix = ctx + "task/opinion";
    var channelNoDatas = [[${@dict.getType('next_flow')}]];
    $(function() {
        var options = {
            url: prefix + "/list",
            modalName: "审核回退原因",
            clickToSelect:true,
            pagination:false,
            showSearch:false,
            showRefresh:false,
            columns: [{
                radio: true
            },
                {
                    field: 'checkOpinionId',
                    title: 'ID',
                    visible: false

                },
                {
                    field: 'content',
                    title: '质检不通过原因'
                },
                {
                    field: 'nextFlow',
                    title: '流程指向',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(channelNoDatas, value);
                    }
                }]
        };
        $.table.init(options);
    });
    function submitHandler() {
        var taskId = [[${taskId}]];
        var rowData = $.table.selectRows();
        if($.common.isEmpty(rowData)) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        $.operate.post(
            ctx + "task/usertask/checkUserTask",
            {
                'taskId': taskId,
                'taskStatus': 2,
                'checkOpinion': rowData[0].checkOpinionId
            },
            function (result) {
                $.operate.successCallback(result)
            }
        );
    }
    $(function() {
        $("#nextFlow").select2({
            minimumResultsForSearch: -1
        })
    })

</script>
</body>
</html>
